/*
 * @Description:
 * @Author: ZY
 * @Date: 2020-12-28 11:26:33
 * @LastEditors: ZY
 * @LastEditTime: 2020-12-28 13:34:08
 */
import { getToken,getRefreshToken } from '@/utils/cookies'
import { TableDetail } from '@/types/setting/data-source';

export interface UserState{
    token: string
    refreshToken:string
    currentUser:object
    name: string
    tenantName: string
    avatar: string
    introduction: string
    roles: string[]
    routerList:any[]
    isAdmin: boolean
    email: string

    currentDataSource:TableDetail

    isShowColors:boolean
    breadcrumbList:any
    jumpLoading:boolean
    lang: string
    bread:[]
}

export const state: UserState = {
    token: getToken() || '',
    refreshToken: getRefreshToken() || '',
    currentUser: {},
    name: '',
    isAdmin: false,
    tenantName: '',
    avatar: '',
    introduction: '',
    roles: [],
    routerList: [],
    email: '',

    currentDataSource: {} as TableDetail,
    isShowColors: false,
    breadcrumbList: [],
    jumpLoading: false,
    lang:sessionStorage.getItem('lang')||'zh',
    bread:[]
}
